package com.szwistar.common.datastruct;

import java.util.LinkedList;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.szwistar.common.datastruct.Issues.Issue;


/**
 * 问题/Bug列表
 */
public class Issues extends LinkedList<Issue> {
	private static final long serialVersionUID = -8983014762993072711L;
	static final Logger LOG = LoggerFactory.getLogger(Issues.class);

	/**
	 * 问题/Bug
	 */
	public class Issue {
		public String source;
		public String description;
		public String advice;

		public Issue(String source, String description, String advice) {
			super();
			this.source = source;
			this.description = description;
			this.advice = advice;
		}

		@Override
		public String toString() {
			return "对象：" + source + " 问题：" + description + "建议：" + advice;
		}
	}

	public Issue add(String source, String description, String advice) {
		Issue issue = new Issue(source, description, advice);
		add(issue);
		LOG.error("{}", issue);
		return issue;
	}
}
